<?php

namespace App\Admin\Actions\Grid;

use App\Admin\Forms\CustomHtmlCode;
use Dcat\Admin\Grid\RowAction;

use Dcat\Admin\Widgets\Modal;
class ArticleHtmlCode extends RowAction
{

    /**
     * @return string
     */
	protected $title = '代碼修改';

	protected $path;

    public function render()
    {

        $form = CustomHtmlCode::make()->payload(['html_path'=>$this->path]);

        return Modal::make()
            ->lg()
            ->title($this->title)
            ->body($form)
            ->button(<<<HTML
<a href="javascript:;"><i class="fa fa-file-code-o"></i></a>
HTML
);
    }

    public function htmlCodePath($path){
        $this->path = $path;
        return $this;

    }

}
